package anim;

import java.awt.Color;

import vis.Drawable;

public class SetHighlight extends Frame {

	private Drawable obj = null;
	private Color c = Color.black;
	private Color oc = Color.black;
	private boolean was = false;
	
	public SetHighlight(Drawable obj, Color c)
	{
		this.obj = obj;
		this.c = c;
	}
	
	@Override
	public void doFrame() {
		was = obj.isHighlighted();
		oc = obj.getHighlightColor();
		obj.setHighlight(c);
	}

	@Override
	public void undoFrame() {
		if(was)
			obj.setHighlight(oc);
		else
			obj.resetHighlight();
	}

}
